package com.modelscope.ai.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.modelscope.ai.domain.dto.UserDto;
import com.modelscope.ai.domain.dto.UserLoginDto;
import com.modelscope.ai.domain.dto.UserQueryCriteria;
import com.modelscope.ai.domain.entity.User;
import com.modelscope.ai.domain.vo.OpenIdVo;
import com.modelscope.ai.domain.vo.UserVo;


import java.util.Date;
import java.util.List;

/**
 * @author 20346
 * @description 针对表【user】的数据库操作Service
 * @createDate 2023-12-17 11:26:08
 */
public interface UserService extends IService<User> {

    Page<UserVo> queryAll(UserQueryCriteria userQueryCriteria);


    // 更新用户信息
    void updateUser(UserDto userDto);


    void deleteUser(Long uid);

    UserVo queryById(Long uid);


    /**
     * 校验token是不是有效
     *
     * @param token
     * @return
     */
    boolean verify(String token);




    /**
     * 登录成功，获取token
     * @return 返回token
     */
    String login(UserLoginDto userLoginDto);



    void register(UserDto userDto);

    /**
     * 如果token有效，返回uid
     *
     * @param token
     * @return
     */
    Long getValidUid(String token);


    OpenIdVo openid(String openid);

}
